Skip to content

Conversation

@ybiquitous
Copy link
Contributor

This PR makes a few minor improvements to the documentation of the Timeout.timeout method. The changes include fixing typos and enhancing formatting for better readability.

We can see the latest version of the documentation here:
https://docs.ruby-lang.org/en/master/Timeout.html#method-c-timeout

Also, we can verify this change locally by running:

rdoc
open doc/Timeout.html

This commit makes a few minor improvements to the documentation of the `Timeout.timeout` method.
The changes include fixing typos and enhancing formatting for better readability.

We can see the latest version of the documentation here:
https://docs.ruby-lang.org/en/master/Timeout.html#method-c-timeout

Also, we can verify this change locally by running:

```shell
rdoc
open doc/Timeout.html
```
Comment on lines +224 to +225
# is that Timeout::Error inherits from RuntimeError and might be caught unexpectedly by +rescue+.
# Timeout::ExitException inherits from Exception so it will only be rescued by <tt>rescue Exception</tt>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand those cases will be fixed by @st0012's work to better support Markdown in RDoc, is that correct?
If so I'm not so inclined to have HTML tags here, it looks pretty messy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will fix the rendering though, and the other changes look good so I guess let's go with that for now, and then maybe go back to backticks once RDoc supports them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah if we update RDoc to 7.10 then we can use backticks in rdoc markup too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know when that would happen for ruby/ruby? (since it doesn't seem to work for https://docs.ruby-lang.org/en/master/Timeout.html#method-c-timeout)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting because the rescue one line above is now correctly rendered. And this line is rendered as ‘rescue Exception`. I wonder if the beginning quote is actually not a backtick character 🤔

Copy link
Member

@tompng tompng Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In RDoc format, Only `single_word` is allowed mainly because of the restriction using regexp and gsub in parsing (I think).
Remaining backticks and quotes are converted to multibyte quotes ‘’”“

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that's unfortunate, is there already an issue about that? (I didn't find one, only related ruby/rdoc#1230)
What's the correct workaround for now for multi-word code quoting? <tt>some code</tt>?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<tt> (or use ` with markup: markdown) is the only way for now.
I think there is no issue yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming, I filed ruby/rdoc#1565.
And then I will merge this for now as there is no better way.

@eregon
Copy link
Member

eregon commented Jan 17, 2026

@ybiquitous Thank you for these fixes!

@eregon eregon merged commit 53ee559 into ruby:master Jan 17, 2026
@ybiquitous ybiquitous deleted the improve-timeout-docs branch January 17, 2026 23:34
@ybiquitous
Copy link
Contributor Author

Thanks, too. I look forward to seeing the backtick support in the next RDoc release. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants